package jdk8.date;

import java.time.LocalDate;

public class Test {
    public static void main(String[] args) {
        compareLocalDate();
    }

    /**
     * 比较两个日期之间相差天数
     */
    private static void compareLocalDate(){
        LocalDate d1 = LocalDate.of(2019, 10, 4);
        LocalDate d2 = LocalDate.of(2019, 10, 1);
        System.out.println(d1.toEpochDay()-d2.toEpochDay());
    }
}
